import mutations from '@/store/module/user/mutations'
import actions from '@/store/module/user/actions'
import getters from '@/store/module/user/getters'
import { cloneDeep } from '@web-utils/integrations/lodash'

const state = {
  tokenValid: false,
  empty: true,
  menu: [],
  userType: '',
  sysUser: {
    userId: '',
    username: '',
    password: '',
    createBy: null,
    updateBy: '',
    createTime: '',
    updateTime: '',
    delFlag: '',
    lockFlag: '',
    phone: '',
    avatar: '',
    deptId: '',
    tenantId: '',
    wxOpenid: '',
    miniOpenid: '',
    qqOpenid: null,
    giteeLogin: '',
    oscId: '',
    realityPassword: '',
    deptName: '',
    leaderCode: null,
    companyId: '',
    companyName: '',
    realName: '',
    nickname: '',
    name: '',
    email: ''
  },
  roles: [],
  permissions: {},
  userInfoDetail: {}
}

export const defaultState = cloneDeep(state)

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
